<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>时间轴</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>
    <script type="text/javascript" src="js/cookie.js"></script>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>物流收货信息</legend>
</fieldset>
<div>
    <div class="message">快递编号：<input  name="id" id="id" autocomplete="off" style="border:none;"/></div>
    <div class="message">发货人：<input  name="consignor" id="consignor" autocomplete="off" style="border:none;"/></div>
</div>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>物流时间线</legend>
</fieldset>

<ul class='layui-timeline' id="list">
</ul>


<script src="../layui/layui.js" charset="utf-8"></script>
<script>
    var index;//保存layuiEditID
    $(function () {
        $.ajax({
            url: 'http://localhost:8081/Info/getInfoList',//请求地址
            dataType: 'JSON',//值类型
            data: {
                page:1,
                limit:1,
                time:'',
                content:''
            },//往后端发送的值
            success: function (res) {//成功的回调函数
                console.log(res)
                for (var i =0 ;i<res.data.length;i++) {
                    str1="   <li class='layui-timeline-item'>\n" +
                        "        <i class='layui-icon layui-timeline-axis'></i>\n" +
                        "        <div class='ayui-timeline-content layui-text'>\n" +
                        "            <div class='layui-timeline-title' '> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+res.data[i].time+"</div>\n" +
                        "            <div class='layui-timeline-title' >  &nbsp;&nbsp;&nbsp;"+res.data[i].content+"</div>\n" +
                        "        </div>\n" +
                        "    </li>"
                    $('#list').append(str1);
                }
            },
            error: function (data) {//失败的回调函数
                layer.alert("系统出错");
            }
        })
        $.ajax({
            url: 'http://localhost:8081/Express/getAddExpressList',//请求地址
            dataType: 'JSON',//值类型
            data: {
                page:1,
                limit:1,
                id:localStorage.getItem("id"),
                consignor:''
            },//往后端发送的值
            success: function (res) {//成功的回调函数
                console.log(res.data)
                $("#id").val(localStorage.getItem("id"))
                $("#consignor").val(res.data[0].consignor)
            },
            error: function (data) {//失败的回调函数
                layer.alert("系统出错");
            }
        })
    })
</script>
</body>
</html>